package com.gh.controller.api;

import com.gh.common.result.R;
import com.gh.entity.Dict;
import com.gh.service.DictService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author Eric
 * @Date 2021/10/8 19:50
 * @Version 1.0
 */
@Api(tags = "数据字典")
@RestController
@RequestMapping("/api/core/dict")
@Slf4j
public class DictController {

    @Resource
    private DictService dictService;

    @GetMapping("/getByDictCode/{dictCode}")
    public R getByDictCode(@PathVariable String dictCode){
        List<Dict> list= dictService.getByDictCode(dictCode);
        return R.ok().data("dictList",list);
    }

}
